import 'floor_list_entity.dart';

class ServiceAreaEntity {
  List<ServiceAreaInfo>? rows;

  ServiceAreaEntity({
    this.rows,
  });

  factory ServiceAreaEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['rows'] as List?;
    List<ServiceAreaInfo> protocolList =
        (originList??[]).map((value) => ServiceAreaInfo.fromJson(value)).toList();
    return ServiceAreaEntity(
      rows: protocolList,
    );
  }
}

class ServiceAreaInfo {
  String? name;
  String? floorNo;
  int? id;
  bool isSelected = false;

  List<FloorInfo>? floor = [];

  ServiceAreaInfo({
    this.name,
    this.id,
    this.floorNo,
    this.isSelected = false,
    this.floor
  });

  ServiceAreaInfo.fromJson(Map data) {
    name = data['name'];
    id = data['id'];
    floorNo = data['floorNo'];
    isSelected = data['isSelected'] = false;
  }
}
